file = open('./1.txt','r',encoding='utf8')
print(file.read())

file.close()
# f2 = open('./1.txt','w',encoding='utf-8')
# f2.write('hello world')
# f2.close()

# f3 = open('./1.txt','a',encoding='utf-8')
# f3.write('hello world')
# f3.close()

# with open('./1.txt','r',encoding='utf-8') as f4:
#      # print(f4.read(3))
#     while True:
#         line = f4.readline()
#         if not line:
#             break
#         print(line.strip())
#
# with open('./1.txt','r',encoding='utf8')as f4:
#     print(f4.readlines())
#
with open( './1.txt','r',encoding='utf8')as f4:
    import os

    with open('./1.txt','a',encoding='utf-8') as file4:
        str4 = 'hello world4'
        file4.write(str4)
        list4 = ['\nhello world1','\nhello world6']
        file4.writelines(list4)

    print("-----------------")
    with open('./1.png', 'rb') as file:
        with open('./2.png', 'wb') as file2:
            while True:
                data = file.read(1024)
                if not data:
                    break
                file2.write(data)

    with open('./1.txt','r',encoding='utf-8') as file:
        print(file.tell())
        line = file.read(3)
        print(file.tell())

    os.remove('./2.png')
    os.remove('./4442.png')

    os.rename('./1.png', './a.png')
    os.mkdir('test1')
    os.mkdir('test2')
    os.mkdir('test2')
    print(os.getcwd())
    print(os.listdir('./'))